import request from '@/util/request'
import type { LoginForm, UserInfo } from '@/types/user/index'

/**
 * 手机号登录
 * @param loginForm
 * @returns
 */
export const phoneLogin = async (loginForm: LoginForm) => {
  return await request.get<UserInfo>(`/login/cellphone?phone=${loginForm.username}&password=${loginForm.password}`)
}

/**
 * 退出登录
 * @returns
 */
export const logout = async () => {
  return await request.get<{ code: number }>('/logout')
}
